<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>预约人数限制</title>
</head>
<link rel="stylesheet" href="../../lib/layui/css/layui.css"/>
<script src="../../js/common.js"></script>
<script src="../../lib/layui/layui.js"></script>
<script src="../../js/xadmin.js"></script>
<body>
<div class="am-fl am-cf ">
    <strong class="am-text-primary am-text-lg pagetitle">接诊人数设置</strong> / <small>Number of patients to be treated</small>
</div>
<hr> <!-- 分割线 -->
<form class="layui-form" action="" id="form2">
    <div class="layui-form-item">
        <label class="layui-form-label">上午最大接诊人数：</label>
        <div class="layui-input-inline">
            <input type="text" name="amNamber"  autocomplete="off" placeholder="请输入接诊人数"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">下午最大接诊人数</label>
        <div class="layui-input-inline">
            <input type="text" name="pmNamber"  autocomplete="off" placeholder="请输入接诊人数"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">晚上最大接诊人数</label>
        <div class="layui-input-inline">
            <input type="text" name="nightNamber"  autocomplete="off" placeholder="请输入接诊人数"
                   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
</form>
</body>
</html>
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        //监听提交
        form.on('submit(demo1)', function (data) {
            useAjax("/JT90/patientNamber",data.field,"JSON","GET",function(count){
                if (count>0){
                    layer.msg("修改成功");
                    //调用重置刷新
                    //执行重置清空内容
                    $("#form2")[0].reset();
                    layui.form.render();
                }else{
                    layer.msg("修改失败");
                }
            })
            return false;
        });
    });
</script>